<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no" />
	<title>首页</title>
	<link rel="stylesheet" type="text/css" href="../c/aui.css" />
	<style>
		body {
			background-color: transparent;
			background-color: #000;
		}
	</style>
</head>

<body>
	<div class="aui-content">
		<div class="aui-content-padded">
			<div class="aui-btn aui-btn-danger aui-btn-block" tapmode onclick="_alert()">alert</div>
			<div class="aui-btn aui-btn-danger aui-btn-block" tapmode onclick="_sendMessage()">sendMessage</div>
			<div class="aui-btn aui-btn-danger aui-btn-block" tapmode onclick="_alert2()">_alert2</div>
		</div>
	</div>
</body>

<script type="text/javascript" src="../j/api.js"></script>
<script>
	apiready = function() {
		_alert2();
	}

	function _alert() {
		_suxiangw_msg({
			name: 'alert',
			content: "欢看视频次数已耗尽，购买VIP可无限观看。",
			rightTitle: '购买VIP',
		}, function(ret) {
			// console.info(JSON.stringify(ret));
			dialogBox.close({
				dialogName: 'alert'
			});
			if (ret.eventType == 'left') {
			} else if (ret.eventType == 'right') {
				if(_getPrefs('_user')){
					_url({url:'member_vip',title:'VIP会员'});
				}else{
					return _login();
				}
			}
		});
	}
	function _alert2() {
		_suxiangw_msg({
			content: '余额不足，请先充值哦！',
			rightTitle:'充值'
		}, function(ret) {
			 console.info(JSON.stringify(ret));
		});
		return;
		_suxiangw_msg2({
			rightTitle: '立刻观看视频',
		}, function(ret) {
			 console.info(JSON.stringify(ret));
		});
	}
	function _sendMessage() {
		_suxiangw_msg({
			name: 'sendMessage',
			content: "欢看视频次数已耗尽，购买VIP可无限观看。",
			rightTitle: '购买VIP',
		}, function(ret) {
			// console.info(JSON.stringify(ret));
			dialogBox.close({
				dialogName: 'alert'
			});
			if (ret.eventType == 'left') {
			} else if (ret.eventType == 'right') {
				if(_getPrefs('_user')){
					_url({url:'member_vip',title:'VIP会员'});
				}else{
					return _login();
				}
			}
		});
	}
</script>

</html>
